﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acoris.Text
{
#if WIN2D && NET_UWP
    using Microsoft.Graphics.Canvas.Text;
    using Windows.UI.Text;
#endif

    /// <summary>
    /// represents many extension method for TypeFace class
    /// </summary>
    public static class TypeFaceExtension
    {
#if WIN2D && NET_UWP

        /// <summary>
        /// 
        /// </summary>
        /// <param name="face"></param>
        /// <returns></returns>
        public static CanvasTextFormat Make(this TypeFace face) {
            return new CanvasTextFormat
            {
                FontSize = face.FontSize,
                FontFamily = face.FontFamily,
                IncrementalTabStop = face.TabIncreament,
                WordWrapping = CanvasWordWrapping.Character,
                FontStyle = (FontStyle)face.FontStyle,
                FontWeight = new FontWeight { Weight = (ushort)face.FontWeight }
            };
        }
#endif
    }
}
